<?php
declare (strict_types = 1);

namespace app\api\model;

use think\facade\Cache;
use think\Model;

class SupplyBanner extends Model
{
    protected static function init()
    {
        self::afterInsert(function ($user) {
            Cache::store('redis')->set('banner',self::select());
        });
        self::afterUpdate(function ($user) {
            Cache::store('redis')->set('banner',self::select());
        });
        self::afterDelete(function ($user) {
            Cache::store('redis')->set('banner',self::select());
        });
    }
}